extends "../cTDA_4/cTDA_4.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "上忍"
	lv = 3
	attCoe.atk = 31 / 8.5 * 2 / 3
	attCoe.maxHp = 720 / 112.5 / 3

	addCdSkill("sr",10)
	addSkillTxt("影之道：每召唤一个分身，攻击提升18%，血量提升10%")
	addSkillTxt("分身精通：召唤在自身攻击距离内的友方分身（除忍者这一系），继承技能，攻击力固定为18点，持续时间8秒[cd:10秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	var chas = getAllChas(2)
	if id == "sr" :
		if !chas.size():return 
		var waitrnd = []
		for i in chas:
			if i.id.find("cTDA_4") != -1:break
			if abs(i.cell.x - cell.x ) <= att.atkRan && abs(i.cell.y - cell.y ) <= att.atkRan:
				waitrnd.append(i)
		if !waitrnd.size():return 
		if sys.test:print("分身精通")
		cst("分身精通","000000",position)
		var ncha = sys.rndListItem(waitrnd)
		var tcha = newChara(ncha.id,ncha.cell)
		if tcha != null:
			tcha.attInfo.atk = 18
			tcha.upAtt()
			tcha.addBuff(BF.new(1))
			addBuff(skill_buff.new(1))

class BF:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		life = lv * 8
	func _del():
		._del()
		sys.main.delMatChara(masCha)
